How to form a bitonic sequence from a random input?
Could you elaborate on the process of forming a bitonic sequence from a random input? Specifically, how do you identify the peak and the valley in the sequence, and ensure that the sequence is strictly increasing before the peak and strictly decreasing after the valley? Additionally, what strategies or algorithms do you utilize to achieve this transformation, and how do you handle edge cases such as sequences with all equal elements or sequences that are already bitonic?